package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Phone     string `gorm:"type:varchar(11);not null"`  //手机号
	Password  string `gorm:"type:varchar(32);not null"`  //密码
	NickName  string `gorm:"type:varchar(30);not null"`  //昵称
	HeadImage string `gorm:"type:varchar(500);not null"` //头像
	Status    string `gorm:"type:varchar(11);not null"`  //状态
}

type Course struct {
	gorm.Model
	Title         string  `gorm:"type:varchar(30);not null"`
	TeacherId     int     `gorm:"type:int;not null"`
	Category      string  `gorm:"type:varchar(30);not null"`
	Price         float64 `gorm:"type:decimal(10,2);not null"`
	OriginalPrice float64 `gorm:"type:decimal(10,2);not null"`
	CourseImage   string  `gorm:"type:varchar(500);not null"`
	Intro         string  `gorm:"type:varchar(30);not null"`
	LearnCount    int     `gorm:"type:int;not null"`
	Status        string  `gorm:"type:varchar(11);not null"`
}

type Teacher struct {
	gorm.Model
	Name         string `gorm:"type:varchar(30);not null"`
	Intro        string `gorm:"type:varchar(30);not null"`
	TeacherImage string `gorm:"type:varchar(500);not null"`
}

type Evaluation struct {
	gorm.Model
	CourseId    int    `gorm:"type:int;not null"`
	UserId      int    `gorm:"type:int;not null"`
	Score       string `gorm:"type:varchar(30);not null"`
	Content     string `gorm:"type:varchar(500);not null"`
	IsAnonymous string `gorm:"type:varchar(30);not null"`
	Status      string `gorm:"type:varchar(30);not null"`
}

type Collection struct {
	gorm.Model
	UserId   int    `gorm:"type:int;not null"`
	CourseId int    `gorm:"type:int;not null"`
	Status   string `gorm:"type:varchar(30);not null"`
}
